package com.henan.provideservice.controller;

import com.henan.provideservice.api.request.DeveloperRequest;
import com.henan.provideservice.api.response.DeveloperResponse;
import com.henan.provideservice.domain.vo.RouteMeta;
import com.henan.provideservice.domain.vo.RouteRecord;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.*;
import org.springframework.util.RouteMatcher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

@RestController
@RequestMapping("/route")
@AllArgsConstructor
@Slf4j
public class RouteController {

    @GetMapping()
    public List<RouteRecord> getRoutes() {
        ArrayList<RouteRecord> routes = new ArrayList<>();

        RouteRecord route1 = new RouteRecord(
                1,
                "Quality",
                "/quality",
                0,
                "view/QualityRiskManagement.vue",
                1,
                new RouteMeta("Quality", "protect"));

        RouteRecord route2 = new RouteRecord(
                2,
                "Production",
                "/production",
                0,
                "",
                2,
                new RouteMeta("Production", "ad-product"));

        RouteRecord route3 = new RouteRecord(
                3,
                "ProductionData",
                "/production-data",
                2,
                "view/Production.vue",
                3,
                new RouteMeta("生产数据", "icon-test"));

        RouteRecord route4 = new RouteRecord(
                4,
                "Material",
                "/material",
                0,
                "",
                4,
                new RouteMeta("Material", "folder-one"));

        RouteRecord route5 = new RouteRecord(
                5,
                "MaterialInventory",
                "/material-inventory",
                4,
                "view/MaterialInventory.vue",
                5,
                new RouteMeta("材料库存", "icon-test"));

        RouteRecord route6 = new RouteRecord(
                6,
                "MaterialReverseCheck",
                "/material-reverse-check",
                4,
                "view/MaterialReverseCheck.vue",
                6,
                new RouteMeta("材料反查", "icon-test"));

        RouteRecord route7 = new RouteRecord(
                7,
                "Warehouse",
                "/warehouse",
                0,
                "view/Warehouse.vue",
                7,
                new RouteMeta("Warehouse", "building-three"));


        RouteRecord route10 = new RouteRecord(
                10,
                "Setting",
                "/setting",
                0,
                "view/Setting.vue",
                10,
                new RouteMeta("设置页面", "setting"));
        routes.add(route1);
        routes.add(route2);
        routes.add(route3);
        routes.add(route4);
        routes.add(route5);
        routes.add(route6);
        routes.add(route7);
        routes.add(route10);
        return routes;
    }

}
